package xiegd.study.proxy.jdk2;

import java.lang.reflect.Proxy;

/**
 * @Author: xieguangda
 * @Description:
 * @Date: 2023/9/21 15:53
 */
public class Client {

    public static void main(String[] args) {
        MyInterfaceImpl myInterfaceImpl = new MyInterfaceImpl();
        MyInvocationHandler myInvocationHandler = new MyInvocationHandler(myInterfaceImpl);
        MyInterface myInterfaceProxy = (MyInterface) Proxy.newProxyInstance(
                MyInterfaceImpl.class.getClassLoader(),
                new Class<?>[]{MyInterface.class},
                myInvocationHandler);
        myInterfaceProxy.doSomething();
    }
}
